<template>
    <div id="chartLine" style="width: 100%;height: 200px">
        order
    </div>
</template>

<script>
    export default {
        name: "Statistic",
        data(){
          return{

          }
        },
        // 页面加载事件
        created(){
            this.costAndSell();
            // this. branchaddressAndProfit();
            // this.findAllGoodsmsg();
        },
        methods:{
            //本店销售额与成本额
            costAndSell(){
                const eCharts=require('echarts')
                this.$http.post("branch/costAndSell").then(function (result) {
                    if (result.data.code===5001){
                        this.$message.success(result.data.msg);
                        location.href="enter.jsp";
                    }
                    result.data.data.forEach(item => {
                        option1.series[0].data.push({name:'销售额',value:item.sell})
                        option1.series[0].data.push({name:'成本额',value:item.cost})
                    })
                    myChart1.setOption(option1);
                })
            },
        }
    }
</script>

<style scoped>

</style>